package com.team.book.mapper;

import com.team.book.domain.Book;
import com.team.book.domain.BookExample;
import com.team.book.web.dto.BookDTO;
import com.team.book.web.dto.BookStatisticsDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface BookMapper {
    long countByExample(BookExample example);

    int deleteByExample(BookExample example);

    int deleteByPrimaryKey(Long id);

    int insert(Book record);

    int insertSelective(Book record);

    List<Book> selectByExample(BookExample example);

    Book selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") Book record, @Param("example") BookExample example);

    int updateByExample(@Param("record") Book record, @Param("example") BookExample example);

    int updateByPrimaryKeySelective(Book record);

    int updateByPrimaryKey(Book record);

    List<BookDTO> query(Map<String,Object> map);

    long count(Map<String,Object> map);

    List<BookStatisticsDTO> queryClassificationStatistics(Map<String,Object> map);

    long countClassificationStatistics(Map<String,Object> map);

    List<BookStatisticsDTO> queryBorrowStatistics(Map<String,Object> map);

    long countBorrowStatistics(Map<String,Object> map);

}